//表示引入HTTP模块
var http = require('http');
/*
request  获取url传过来的信息

response   给游览器响应信息
*/
http.createServer(function (request, response) {
    //设置响应头
  response.writeHead(200, {'Content-Type': 'text/plain'});
  //表示给我们页面上输出一句话并且结束响应
  response.end('Hello World1');
  const url=require('url');
var api='http://www.itying.com?name=san&age=20';
var getValue=url.parse(api,true).query;
console.log(getValue);
console.log(`姓名；${getValue.name}--年龄:${getValue.age}`);

}).listen(8081);//端口
-
console.log('Server running at http://127.0.0.1:8081/');